<template>
  <div v-loading="loading" class="login-container">


    <el-row v-if="checkresult == undefined" class="wscn-http404" :gutter="20">
      <el-col class="pic-404" :span="10">
        <img src="../../../assets/images/loadding.gif">
      </el-col>
      <el-col class="bullshit" :span="10">
        <div class="bullshit__oops">等待!</div>
        <div class="bullshit__info">健康信息评估中</div>
        <div class="bullshit__headline">{{ message }}</div>
        <div class="bullshit__info">请耐心等待医生给出答复，在此之前，您可浏览本平台的其它功能</div>
        <a href="/user/index" class="bullshit__return-home">查看疫情分布</a>
      </el-col>
    </el-row>
    <el-row v-else>
      <el-col :span="16">
        <el-card style="margin-top: 30px;border: 1px solid #1fac1a">

          <div slot="header" class="clearfix">
            <span>亲爱的用户 "{{formLabelAlign.realname}}" 您的检测结果为：</span>
          </div>
          <div>
            年龄：{{formLabelAlign.age}}岁
          </div>
          <div>
            性别：{{formLabelAlign.gender == true ? "男性" :"女性"}}
          </div>
          <div class="checkitem">
            1: 红细胞计数：{{formLabelAlign.userHealth.rbc}} <span style="float: right">（{{checkresult.hb == true ?"经系统检测，患有贫血病":"经系统检测，未患有有贫血病" }}） </span>
          </div>
          <div class="checkitem">
            2: 血红蛋白浓度：{{formLabelAlign.userHealth.hb}} <span style="float: right">（{{checkresult.hb == true ?"经系统检测，患有贫血病":"经系统检测，未患有有贫血病" }}）</span>
          </div>
          <div class="checkitem">
            3:
            血小板计数：{{formLabelAlign.userHealth.plt}}<span style="float: right"> （{{ checkresult.plt == true ?"经系统检测，患有血栓病":"经系统检测，未患有有血栓病" }}）</span>
          </div>
          <div class="checkitem">
            4:
            淋巴细胞比值：{{formLabelAlign.userHealth.ly}} <span style="float: right">（{{checkresult.ly == true ?"经系统检测，患有淋巴细胞增多症":"经系统检测，未患有淋巴细胞增多症" }}）</span>
          </div>
          <div class="checkitem">
            5:
            单核细胞计数：{{formLabelAlign.userHealth.mono}} <span style="float: right">（{{checkresult.mono == true ?"经系统检测，患有疟疾":"经系统检测，未患有疟疾" }}）</span>
          </div>
          <div class="checkitem">
            6: 转氨酶：{{formLabelAlign.userHealth.zam}} <span style="float: right">（{{checkresult.zam == true ?"经系统检测，患有转氨酶过多时肝病":"经系统检测，未患有转氨酶过多时肝病" }}）</span>
          </div>
          <div class="checkitem">
            7: 癌胚抗原：{{formLabelAlign.userHealth.apky}} <span style="float: right">（{{checkresult.apky == true ?"经系统检测，患有癌症":"经系统检测，未患有癌症" }}）</span>
          </div>
          <div class="checkitem">
            8: 尿酸：{{formLabelAlign.userHealth.ns}} <span style="float: right">（{{checkresult.ns == true ?"经系统检测，患有肾病":"经系统检测，未患有肾病" }}）</span>
          </div>
          <div class="checkitem">
            8: 血糖：{{formLabelAlign.userHealth.xt}} <span style="float: right">（{{checkresult.xt == true ?"患有糖尿病":"经系统检测，未患有糖尿病" }}）</span>
          </div>
          <div class="checkitem">
            9: 血压：{{formLabelAlign.userHealth.xy}} <span style="float: right">（{{checkresult.xy == true ?"患有高血压":"经系统检测，未患有高血压" }}）</span>
          </div>
          <div class="checkitem">

          </div>

        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import {updateMyInfo, getUserBaseInfo, getlastSpiderlog} from '@/api/user'
  import {getToken, setToken, removeToken} from '@/utils/auth'
  import {regionData} from "element-china-area-data";

  export default {
    name: 'login',
    data() {
      return {
        value: new Date(), // 当前月份
        qiandaolist: [],
        myinfo: undefined,
        checkresult:undefined,
        loading: true,
        formLabelAlign: {},
        yiqingdata: undefined,
      }
    },
    created() {
      this.getBaseInfo()
    },

    computed: {
      message() {
        return '我们已经为您分配了专业医生 ......'
      }
    },
    watch: {
      value: function () {

      }
    },
    methods: {
      getBaseInfo() {
        getUserBaseInfo({}).then(res => {
          this.loading = false;
          this.formLabelAlign = res.info
          this.checkresult = this.formLabelAlign.userHealthReport;
          console.log(this.formLabelAlign)
          if (this.formLabelAlign.citys == undefined || this.formLabelAlign.citys == '') {
            this.formLabelAlign.citys = []
          } else {
            this.formLabelAlign.citys = JSON.parse(this.formLabelAlign.citys)
          }
        })
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .clearfix {
    font-size: x-large;
    color: #454545;
  }

  .checkitem {
    margin-top: 10px;
    font-size: medium;
    font-weight: normal;

  }

  .wscn-http404 {
    position: relative;
    width: 1200px;
    margin: 20px auto 60px;
    padding: 0 100px;
    overflow: hidden;

    .pic-404 {
      position: relative;
      float: left;
      width: 600px;
      padding: 150px 0;
      overflow: hidden;

      &__parent {
        width: 100%;
      }

      &__child {
        position: absolute;

        &.left {
          width: 80px;
          top: 17px;
          left: 220px;
          opacity: 0;
          animation-name: cloudLeft;
          animation-duration: 2s;
          animation-timing-function: linear;
          animation-fill-mode: forwards;
          animation-delay: 1s;
        }

        &.mid {
          width: 46px;
          top: 10px;
          left: 420px;
          opacity: 0;
          animation-name: cloudMid;
          animation-duration: 2s;
          animation-timing-function: linear;
          animation-fill-mode: forwards;
          animation-delay: 1.2s;
        }

        &.right {
          width: 62px;
          top: 100px;
          left: 500px;
          opacity: 0;
          animation-name: cloudRight;
          animation-duration: 2s;
          animation-timing-function: linear;
          animation-fill-mode: forwards;
          animation-delay: 1s;
        }

        @keyframes cloudLeft {
          0% {
            top: 17px;
            left: 220px;
            opacity: 0;
          }
          20% {
            top: 33px;
            left: 188px;
            opacity: 1;
          }
          80% {
            top: 81px;
            left: 92px;
            opacity: 1;
          }
          100% {
            top: 97px;
            left: 60px;
            opacity: 0;
          }
        }
        @keyframes cloudMid {
          0% {
            top: 10px;
            left: 420px;
            opacity: 0;
          }
          20% {
            top: 40px;
            left: 360px;
            opacity: 1;
          }
          70% {
            top: 130px;
            left: 180px;
            opacity: 1;
          }
          100% {
            top: 160px;
            left: 120px;
            opacity: 0;
          }
        }
        @keyframes cloudRight {
          0% {
            top: 100px;
            left: 500px;
            opacity: 0;
          }
          20% {
            top: 120px;
            left: 460px;
            opacity: 1;
          }
          80% {
            top: 180px;
            left: 340px;
            opacity: 1;
          }
          100% {
            top: 200px;
            left: 300px;
            opacity: 0;
          }
        }
      }
    }

    .bullshit {
      position: relative;
      float: left;
      width: 300px;
      padding: 150px 0;
      overflow: hidden;

      &__oops {
        font-size: 32px;
        font-weight: bold;
        line-height: 40px;
        color: #1482f0;
        opacity: 0;
        margin-bottom: 20px;
        animation-name: slideUp;
        animation-duration: 0.5s;
        animation-fill-mode: forwards;
      }

      &__headline {
        font-size: 20px;
        line-height: 24px;
        color: #1482f0;
        opacity: 0;
        margin-bottom: 10px;
        animation-name: slideUp;
        animation-duration: 0.5s;
        animation-delay: 0.1s;
        animation-fill-mode: forwards;
      }

      &__info {
        font-size: 13px;
        line-height: 21px;
        color: grey;
        opacity: 0;
        margin-bottom: 30px;
        animation-name: slideUp;
        animation-duration: 0.5s;
        animation-delay: 0.2s;
        animation-fill-mode: forwards;
      }

      &__return-home {
        display: block;
        float: left;
        width: 110px;
        height: 36px;
        background: #1482f0;
        border-radius: 100px;
        text-align: center;
        color: #ffffff;
        opacity: 0;
        font-size: 14px;
        line-height: 36px;
        cursor: pointer;
        animation-name: slideUp;
        animation-duration: 0.5s;
        animation-delay: 0.3s;
        animation-fill-mode: forwards;
      }

      @keyframes slideUp {
        0% {
          transform: translateY(60px);
          opacity: 0;
        }
        100% {
          transform: translateY(0);
          opacity: 1;
        }
      }
    }
  }

</style>
